//
//  ForgetPasswordView.m
//  JunZeWristband
//
//  Created by Kendama on 2017/8/16.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "ForgetPasswordView.h"

@implementation ForgetPasswordView

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        [self masLayoutSubview];
        
    }
    return self;
}

- (PhoneTextFieldView *)phoneView
{
    if(!_phoneView)
    {
        UIView *superView = self;
        _phoneView = [[PhoneTextFieldView alloc]init];
        _phoneView.line.hidden = YES;
        _phoneView.backgroundColor = [UIColor colorWithRed:243/255.0 green:252/255.0 blue:255/255.0 alpha:1];
        _phoneView.phoneTextField.placeholder = MyNSLocalizedString(@"请输入手机号码");
        _phoneView.iconImageView.image = [UIImage imageNamed:@"icon_phone1"];
        _phoneView.phoneTextField.keyboardType = UIKeyboardTypePhonePad;
        [superView addSubview:_phoneView];
    }
    return _phoneView;
}
- (VerifyTextFieldView *)verifyView
{
    if(!_verifyView)
    {
        UIView *superView = self;
        _verifyView = [[VerifyTextFieldView alloc]init];
        _verifyView.backgroundColor = [UIColor colorWithRed:243/255.0 green:252/255.0 blue:255/255.0 alpha:1];
        _verifyView.verifyTextField.placeholder = MyNSLocalizedString(@"请输入验证码");
        _verifyView.iconImageView.image = [UIImage imageNamed:@"icon_verify"];
        _verifyView.verifyTextField.keyboardType = UIKeyboardTypePhonePad;
        [superView addSubview:_verifyView];
    }
    return _verifyView;
}
- (PhoneTextFieldView *)passwordView
{
    if(!_passwordView)
    {
        UIView *superView = self;
        _passwordView = [[PhoneTextFieldView alloc]init];
        [superView addSubview:_passwordView];
        _passwordView.line.hidden = YES;
        _passwordView.backgroundColor = [UIColor colorWithRed:243/255.0 green:252/255.0 blue:255/255.0 alpha:1];
        _passwordView.phoneTextField.placeholder = MyNSLocalizedString(@"请输入密码");
        _passwordView.iconImageView.image = [UIImage imageNamed:@"icon_code1"];
        _passwordView.phoneTextField.secureTextEntry = YES;
    }
    return _passwordView;
}

- (UIButton *)registerButton
{
    if(!_registerButton)
    {
        UIView *superView = self;
        _registerButton = [[UIButton alloc]init];
        [superView addSubview:_registerButton];
        [_registerButton setTitle:MyNSLocalizedString(@"提交") forState:UIControlStateNormal];
        [_registerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_registerButton setBackgroundImage:[UIImage imageNamed:@"but_login"] forState:UIControlStateNormal];
    }
    return _registerButton;
}


- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    [self.phoneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(67));
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(60));
        make.right.mas_equalTo(superView.mas_right).with.offset(px1080Width(-60));
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    [self.verifyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.phoneView.mas_bottom).with.offset(px1920Height(41));
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(60));
        make.right.mas_equalTo(superView.mas_right).with.offset(px1080Width(-60));
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    [self.passwordView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.verifyView.mas_bottom).with.offset(px1920Height(41));
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(60));
        make.right.mas_equalTo(superView.mas_right).with.offset(px1080Width(-60));
        make.height.mas_equalTo(px1920Height(152));
    }];
    
    
    [self.registerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.passwordView.mas_bottom).with.offset(px1920Height(132));
        make.centerX.mas_equalTo(superView.mas_centerX);
    }];
    
}

@end
